/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.apli.haiam.ejb.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Informática
 */
@Entity
@Table(name = "far_proovedor")
@NamedQueries({
    @NamedQuery(name = "FarProovedor.findAll", query = "SELECT f FROM FarProovedor f")})
public class FarProovedor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "pro_id")
    private Integer proId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "pro_nombre_comercial")
    private String proNombreComercial;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 256)
    @Column(name = "pro_razon_social")
    private String proRazonSocial;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 16)
    @Column(name = "pro_ruc")
    private String proRuc;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "pro_representante_legal")
    private String proRepresentanteLegal;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 128)
    @Column(name = "pro_direccion")
    private String proDireccion;
    @Size(max = 16)
    @Column(name = "pro_telefono")
    private String proTelefono;
    @Size(max = 128)
    @Column(name = "pro_mail")
    private String proMail;
    @Size(max = 16)
    @Column(name = "pro_fax")
    private String proFax;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 32)
    @Column(name = "pro_ciudad")
    private String proCiudad;
    @OneToMany(mappedBy = "farProovedor", fetch = FetchType.LAZY)
    private List<FarIngresoMedicamento> farIngresoMedicamentoList;
    @JoinColumn(name = "fct_id", referencedColumnName = "fct_id")
    @ManyToOne(fetch = FetchType.LAZY)
    private FarContacto farContacto;

    public FarProovedor() {
    }

    public FarProovedor(Integer proId) {
        this.proId = proId;
    }

    public FarProovedor(Integer proId, String proNombreComercial, String proRazonSocial, String proRuc, String proRepresentanteLegal, String proDireccion, String proCiudad) {
        this.proId = proId;
        this.proNombreComercial = proNombreComercial;
        this.proRazonSocial = proRazonSocial;
        this.proRuc = proRuc;
        this.proRepresentanteLegal = proRepresentanteLegal;
        this.proDireccion = proDireccion;
        this.proCiudad = proCiudad;
    }

    public Integer getProId() {
        return proId;
    }

    public void setProId(Integer proId) {
        this.proId = proId;
    }

    public String getProNombreComercial() {
        return proNombreComercial;
    }

    public void setProNombreComercial(String proNombreComercial) {
        this.proNombreComercial = proNombreComercial;
    }

    public String getProRazonSocial() {
        return proRazonSocial;
    }

    public void setProRazonSocial(String proRazonSocial) {
        this.proRazonSocial = proRazonSocial;
    }

    public String getProRuc() {
        return proRuc;
    }

    public void setProRuc(String proRuc) {
        this.proRuc = proRuc;
    }

    public String getProRepresentanteLegal() {
        return proRepresentanteLegal;
    }

    public void setProRepresentanteLegal(String proRepresentanteLegal) {
        this.proRepresentanteLegal = proRepresentanteLegal;
    }

    public String getProDireccion() {
        return proDireccion;
    }

    public void setProDireccion(String proDireccion) {
        this.proDireccion = proDireccion;
    }

    public String getProTelefono() {
        return proTelefono;
    }

    public void setProTelefono(String proTelefono) {
        this.proTelefono = proTelefono;
    }

    public String getProMail() {
        return proMail;
    }

    public void setProMail(String proMail) {
        this.proMail = proMail;
    }

    public String getProFax() {
        return proFax;
    }

    public void setProFax(String proFax) {
        this.proFax = proFax;
    }

    public String getProCiudad() {
        return proCiudad;
    }

    public void setProCiudad(String proCiudad) {
        this.proCiudad = proCiudad;
    }

    public List<FarIngresoMedicamento> getFarIngresoMedicamentoList() {
        return farIngresoMedicamentoList;
    }

    public void setFarIngresoMedicamentoList(List<FarIngresoMedicamento> farIngresoMedicamentoList) {
        this.farIngresoMedicamentoList = farIngresoMedicamentoList;
    }

    public FarContacto getFarContacto() {
        return farContacto;
    }

    public void setFarContacto(FarContacto farContacto) {
        this.farContacto = farContacto;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (proId != null ? proId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FarProovedor)) {
            return false;
        }
        FarProovedor other = (FarProovedor) object;
        if ((this.proId == null && other.proId != null) || (this.proId != null && !this.proId.equals(other.proId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.apli.haiam.ejb.entidades.FarProovedor[ proId=" + proId + " ]";
    }
    
}
